Optimal. Leaf size=223 \[ \frac{\sin (c+d x) \left (6 a^2 b (2 A+3 C)+4 a^3 B+16 a b^2 B+3 A b^3\right )}{6 d}+\frac{a \sin (c+d x) \cos (c+d x) \left (3 a^2 (3 A+4 C)+20 a b B+6 A b^2\right )}{24 d}+\frac{1}{8} x \left (a^3 (3 A+4 C)+12 a^2 b B+12 a b^2 (A+2 C)+8 b^3 B\right )+\frac{(4 a B+3 A b) \sin (c+d x) \cos ^2(c+d x) (a+b \sec (c+d x))^2}{12 d}+\frac{A \sin (c+d x) \cos ^3(c+d x) (a+b \sec (c+d x))^3}{4 d}+\frac{b^3 C \tanh ^{-1}(\sin (c+d x))}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.656655, antiderivative size = 223, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 41, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.146, Rules used = {4094, 4074, 4047, 8, 4045, 3770} \[ \frac{\sin (c+d x) \left (6 a^2 b (2 A+3 C)+4 a^3 B+16 a b^2 B+3 A b^3\right )}{6 d}+\frac{a \sin (c+d x) \cos (c+d x) \left (3 a^2 (3 A+4 C)+20 a b B+6 A b^2\right )}{24 d}+\frac{1}{8} x \left (a^3 (3 A+4 C)+12 a^2 b B+12 a b^2 (A+2 C)+8 b^3 B\right )+\frac{(4 a B+3 A b) \sin (c+d x) \cos ^2(c+d x) (a+b \sec (c+d x))^2}{12 d}+\frac{A \sin (c+d x) \cos ^3(c+d x) (a+b \sec (c+d x))^3}{4 d}+\frac{b^3 C \tanh ^{-1}(\sin (c+d x))}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4094
Rule 4074
Rule 4047
Rule 8
Rule 4045
Rule 3770
Rubi steps
\begin{align*} \int \cos ^4(c+d x) (a+b \sec (c+d x))^3 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\frac{A \cos ^3(c+d x) (a+b \sec (c+d x))^3 \sin (c+d x)}{4 d}+\frac{1}{4} \int \cos ^3(c+d x) (a+b \sec (c+d x))^2 \left (3 A b+4 a B+(3 a A+4 b B+4 a C) \sec (c+d x)+4 b C \sec ^2(c+d x)\right ) \, dx\\ &=\frac{(3 A b+4 a B) \cos ^2(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{12 d}+\frac{A \cos ^3(c+d x) (a+b \sec (c+d x))^3 \sin (c+d x)}{4 d}+\frac{1}{12} \int \cos ^2(c+d x) (a+b \sec (c+d x)) \left (6 A b^2+20 a b B+3 a^2 (3 A+4 C)+\left (15 a A b+8 a^2 B+12 b^2 B+24 a b C\right ) \sec (c+d x)+12 b^2 C \sec ^2(c+d x)\right ) \, dx\\ &=\frac{a \left (6 A b^2+20 a b B+3 a^2 (3 A+4 C)\right ) \cos (c+d x) \sin (c+d x)}{24 d}+\frac{(3 A b+4 a B) \cos ^2(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{12 d}+\frac{A \cos ^3(c+d x) (a+b \sec (c+d x))^3 \sin (c+d x)}{4 d}-\frac{1}{24} \int \cos (c+d x) \left (-4 \left (3 A b^3+4 a^3 B+16 a b^2 B+6 a^2 b (2 A+3 C)\right )-3 \left (12 a^2 b B+8 b^3 B+12 a b^2 (A+2 C)+a^3 (3 A+4 C)\right ) \sec (c+d x)-24 b^3 C \sec ^2(c+d x)\right ) \, dx\\ &=\frac{a \left (6 A b^2+20 a b B+3 a^2 (3 A+4 C)\right ) \cos (c+d x) \sin (c+d x)}{24 d}+\frac{(3 A b+4 a B) \cos ^2(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{12 d}+\frac{A \cos ^3(c+d x) (a+b \sec (c+d x))^3 \sin (c+d x)}{4 d}-\frac{1}{24} \int \cos (c+d x) \left (-4 \left (3 A b^3+4 a^3 B+16 a b^2 B+6 a^2 b (2 A+3 C)\right )-24 b^3 C \sec ^2(c+d x)\right ) \, dx-\frac{1}{8} \left (-12 a^2 b B-8 b^3 B-12 a b^2 (A+2 C)-a^3 (3 A+4 C)\right ) \int 1 \, dx\\ &=\frac{1}{8} \left (12 a^2 b B+8 b^3 B+12 a b^2 (A+2 C)+a^3 (3 A+4 C)\right ) x+\frac{\left (3 A b^3+4 a^3 B+16 a b^2 B+6 a^2 b (2 A+3 C)\right ) \sin (c+d x)}{6 d}+\frac{a \left (6 A b^2+20 a b B+3 a^2 (3 A+4 C)\right ) \cos (c+d x) \sin (c+d x)}{24 d}+\frac{(3 A b+4 a B) \cos ^2(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{12 d}+\frac{A \cos ^3(c+d x) (a+b \sec (c+d x))^3 \sin (c+d x)}{4 d}+\left (b^3 C\right ) \int \sec (c+d x) \, dx\\ &=\frac{1}{8} \left (12 a^2 b B+8 b^3 B+12 a b^2 (A+2 C)+a^3 (3 A+4 C)\right ) x+\frac{b^3 C \tanh ^{-1}(\sin (c+d x))}{d}+\frac{\left (3 A b^3+4 a^3 B+16 a b^2 B+6 a^2 b (2 A+3 C)\right ) \sin (c+d x)}{6 d}+\frac{a \left (6 A b^2+20 a b B+3 a^2 (3 A+4 C)\right ) \cos (c+d x) \sin (c+d x)}{24 d}+\frac{(3 A b+4 a B) \cos ^2(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{12 d}+\frac{A \cos ^3(c+d x) (a+b \sec (c+d x))^3 \sin (c+d x)}{4 d}\\ \end{align*}
Mathematica [A] time = 0.937164, size = 215, normalized size = 0.96 \[ \frac{12 (c+d x) \left (a^3 (3 A+4 C)+12 a^2 b B+12 a b^2 (A+2 C)+8 b^3 B\right )+24 a \sin (2 (c+d x)) \left (a^2 (A+C)+3 a b B+3 A b^2\right )+24 \sin (c+d x) \left (3 a^2 b (3 A+4 C)+3 a^3 B+12 a b^2 B+4 A b^3\right )+8 a^2 (a B+3 A b) \sin (3 (c+d x))+3 a^3 A \sin (4 (c+d x))-96 b^3 C \log \left (\cos \left (\frac{1}{2} (c+d x)\right )-\sin \left (\frac{1}{2} (c+d x)\right )\right )+96 b^3 C \log \left (\sin \left (\frac{1}{2} (c+d x)\right )+\cos \left (\frac{1}{2} (c+d x)\right )\right )}{96 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.08, size = 362, normalized size = 1.6 \begin{align*} 3\,{\frac{Ba{b}^{2}\sin \left ( dx+c \right ) }{d}}+{\frac{B\sin \left ( dx+c \right ) \left ( \cos \left ( dx+c \right ) \right ) ^{2}{a}^{3}}{3\,d}}+{\frac{3\,B{a}^{2}bx}{2}}+{\frac{{a}^{3}Cc}{2\,d}}+{\frac{3\,{a}^{3}Ax}{8}}+{\frac{B{b}^{3}c}{d}}+{\frac{A{b}^{3}\sin \left ( dx+c \right ) }{d}}+3\,Ca{b}^{2}x+{\frac{C{b}^{3}\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}}+B{b}^{3}x+{\frac{3\,A{a}^{3}c}{8\,d}}+{\frac{3\,Aa{b}^{2}x}{2}}+{\frac{2\,B{a}^{3}\sin \left ( dx+c \right ) }{3\,d}}+{\frac{3\,A{a}^{3}\sin \left ( dx+c \right ) \cos \left ( dx+c \right ) }{8\,d}}+2\,{\frac{A{a}^{2}b\sin \left ( dx+c \right ) }{d}}+{\frac{3\,B{a}^{2}bc}{2\,d}}+{\frac{{a}^{3}Cx}{2}}+{\frac{3\,Aa{b}^{2}c}{2\,d}}+{\frac{A{a}^{3}\sin \left ( dx+c \right ) \left ( \cos \left ( dx+c \right ) \right ) ^{3}}{4\,d}}+{\frac{{a}^{3}C\sin \left ( dx+c \right ) \cos \left ( dx+c \right ) }{2\,d}}+3\,{\frac{{a}^{2}bC\sin \left ( dx+c \right ) }{d}}+3\,{\frac{Ca{b}^{2}c}{d}}+{\frac{3\,B{a}^{2}b\sin \left ( dx+c \right ) \cos \left ( dx+c \right ) }{2\,d}}+{\frac{3\,Aa{b}^{2}\sin \left ( dx+c \right ) \cos \left ( dx+c \right ) }{2\,d}}+{\frac{A\sin \left ( dx+c \right ) \left ( \cos \left ( dx+c \right ) \right ) ^{2}{a}^{2}b}{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.991735, size = 332, normalized size = 1.49 \begin{align*} \frac{3 \,{\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} A a^{3} - 32 \,{\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B a^{3} + 24 \,{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} C a^{3} - 96 \,{\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} A a^{2} b + 72 \,{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B a^{2} b + 72 \,{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a b^{2} + 288 \,{\left (d x + c\right )} C a b^{2} + 96 \,{\left (d x + c\right )} B b^{3} + 48 \, C b^{3}{\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 288 \, C a^{2} b \sin \left (d x + c\right ) + 288 \, B a b^{2} \sin \left (d x + c\right ) + 96 \, A b^{3} \sin \left (d x + c\right )}{96 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.587165, size = 463, normalized size = 2.08 \begin{align*} \frac{12 \, C b^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) - 12 \, C b^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 3 \,{\left ({\left (3 \, A + 4 \, C\right )} a^{3} + 12 \, B a^{2} b + 12 \,{\left (A + 2 \, C\right )} a b^{2} + 8 \, B b^{3}\right )} d x +{\left (6 \, A a^{3} \cos \left (d x + c\right )^{3} + 16 \, B a^{3} + 24 \,{\left (2 \, A + 3 \, C\right )} a^{2} b + 72 \, B a b^{2} + 24 \, A b^{3} + 8 \,{\left (B a^{3} + 3 \, A a^{2} b\right )} \cos \left (d x + c\right )^{2} + 3 \,{\left ({\left (3 \, A + 4 \, C\right )} a^{3} + 12 \, B a^{2} b + 12 \, A a b^{2}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{24 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.35594, size = 976, normalized size = 4.38 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]